﻿#include "TurnTableDecode_TurnTable_RunningState.h"

#include "TurnTableCodec.h"

TurnTableDecode_TurnTable_RunningState::TurnTableDecode_TurnTable_RunningState(TurnTableCodec *turnTableCodec)
{
  this->turnTableCodec=turnTableCodec;
}

TurnTableDecode_TurnTable_RunningState::~TurnTableDecode_TurnTable_RunningState()
{

}

void TurnTableDecode_TurnTable_RunningState::decode(char* const data)
{
//  uchar state=dataBodyToInt(data,1)&0xff;
//  logSaver->saveLog(QStringLiteral("TurnTableCodec,turnTable running state:%1").arg(QString::number(state,16)),LogSaver::Debug);
//  if (state & 0x01) {
//      emit turnTableCodec->signal_turnTableTargetPositionState(TurnTableCodec::State_Reached,deviceId);
//    }
//  else {
//      emit turnTableCodec->signal_turnTableTargetPositionState(TurnTableCodec::State_NotReached,deviceId);
//    }
//  if (state & 0x02) {
//      emit turnTableCodec->signal_turnTableTargetRateState(TurnTableCodec::State_Reached,deviceId);
//    }
//  else {
//      emit turnTableCodec->signal_turnTableTargetRateState(TurnTableCodec::State_NotReached,deviceId);
//    }
//  if (state & 0x04) {
//      emit turnTableCodec->signal_turnTableTargetStop(TurnTableCodec::State_Reached,deviceId);
//    }
//  else {
//      emit turnTableCodec->signal_turnTableTargetStop(TurnTableCodec::State_NotReached,deviceId);
//    }
//  if (state & 0x08) {
//      emit turnTableCodec->signal_turnTablePowerState(TurnTableCodec::State_PowerOn,deviceId);
//    }
//  else {
//      emit turnTableCodec->signal_turnTablePowerState(TurnTableCodec::State_PowerOff,deviceId);
//    }
//  if (state & 0x10) {
//      emit turnTableCodec->signal_turnTableCircuitState(TurnTableCodec::State_CircuitClosed,deviceId);
//    }
//  else {
//      emit turnTableCodec->signal_turnTableCircuitState(TurnTableCodec::State_CircuitOpened,deviceId);
//    }
//  if (state & 0x20) {
//      emit turnTableCodec->signal_turnTableAmplifierState(TurnTableCodec::State_AmplifierBroken,deviceId);
//    }
//  else {
//      emit turnTableCodec->signal_turnTableAmplifierState(TurnTableCodec::State_AmplifierNormal,deviceId);
//    }
//  if (state & 0x40) {
//      emit turnTableCodec->signal_turnTableRunningState(TurnTableCodec::State_TurnTableRunning,deviceId);
//    }
//  else {
//      emit turnTableCodec->signal_turnTableRunningState(TurnTableCodec::State_TurnTableStoped,deviceId);
//    }
}
